package com.itheima;

import com.baomidou.mybatisplus.annotation.TableId;
import java.util.UUID;
import org.junit.jupiter.api.Test;

public class uploadText1 {

    @Test
    public void test1(){

        String ss = "asdascasc.jpg";
        String aa = "asdascasda.png";


        //截取后缀名
        String _ssname = ss.substring(ss.lastIndexOf("."));
        String _aaname = aa.substring(aa.lastIndexOf("."));

        //使用UUID产生随机名称
        String ssname = UUID.randomUUID().toString() + _ssname;
        String aaname = UUID.randomUUID().toString() + _aaname;

        System.out.println(ssname);
        System.out.println(aaname);
    }
}
